#$ +MergeDIB.c
 
MergeDIB main loop etc.
(C) Copyright Microsoft Corp. 1991-1992.  All rights reserved.

You have a royalty-free right to use, modify, reproduce anddistribute the Sample Files (and/or any modified version) inany way you find useful, provided that you agree that
Microsoft has no warranty obligations or liability for anySample Application Files which are modified.
	
Merges a primary DIB (with any palette) and a secondary DIB (with a different palette) into a single, merged DIB (with special palette).

The special dib and palette are a combination of the two images and palettes so that when the palette is gradually crossfaded (animated), the first and second DIB are partially displayed.  At complete fade, only one of the bitmaps is 'visible', while at a 50-50 mix, both are equally visible (merged).  Pixels are not dithered betweent the images, but are mixed in the palettes.

This technique is limited in the number of pixels that have different targets between bitmaps, but it can create very nice effects when just text is 'faded' in for the target bitmap.

This code is limited so that the two DIBs must be the same size, but this limitation could easily be eliminated by creating an artificial bitmap that is the desired size with a 'blank' (where blank is a chosen color) background.  The smaller image could be centered or otherwise placed in the background (easy to do using the DIB Driver).

End.